package stu.sup.mapper;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import stu.sup.entity.ProductComment;
import stu.sup.entity.ProductCommentExample;

import java.util.List;

public interface ProductCommentMapper {
    int countByExample(ProductCommentExample example);

    int deleteByExample(ProductCommentExample example);

    int deleteByPrimaryKey(Integer commentId);

    int insert(ProductComment record);

    int insertSelective(ProductComment record);

    List<ProductComment> selectByExample(ProductCommentExample example);

    ProductComment selectByPrimaryKey(Integer commentId);

    int updateByExampleSelective(@Param("record") ProductComment record, @Param("example") ProductCommentExample example);

    int updateByExample(@Param("record") ProductComment record, @Param("example") ProductCommentExample example);

    int updateByPrimaryKeySelective(ProductComment record);

    int updateByPrimaryKey(ProductComment record);

    @Select("select * from product_comment where product_id=#{product}")
    List<ProductComment> selectbyproductId(int productId);

    @Select("select * from product_comment where comment_type=#{type}")
    List<ProductComment> selectbyType(String type);
}